#include <iostream>
#include <cstring>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <error.h>
#include <fcntl.h>
const char* path = "./myfifo";
const mode_t mode = 0664;

int main()
{
    int ret = mkfifo(path,mode);
    if(ret < 0)
    {
        perror("mkfifo");
        return 1;
    }

    int fd = open(path, O_WRONLY);
    if(fd < 0)
    {
        perror("open");
        return 2;
    }

    const char* msg = "i am process A";
    write(fd, msg, strlen(msg));
    return 0;
}